package com.ctgu.examonline.dao;

import com.ctgu.examonline.entity.Answer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by 段敏杰 at 2020-08-06 20:28
 */
@Mapper
public interface AnswerDao {

    //查询所有答案,返回结果为AnswerList
    List<Answer> selectAllAnswer();

    //增加一个答案,参数是答案内容和习题编号,答案编号自增
    void insertOneAnswerByDetailAndProNo(@Param("ans_detail") String ans_detail,@Param("pro_no") Integer pro_no);
    //删除一个答案,将对应习题答案编号设置为0(因为不能为空--NN)
    void deleteOneAnswerByNo(@Param("ans_no")Integer ans_no);
    //修改一个答案,修改答案的内容,其他不变,参数是答案内容
    void updateOneAnswerByDetail(@Param("ans_detail") String new_ans_detail,@Param("ans_no") Integer ans_no);
    //查询一个答案,参数是答案编号
    Answer selectOneAnswerByNo(@Param("ans_no") Integer ans_no);
}
